<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
    <meta charset="UTF-8">
    <title>D_civilization_practice</title>
    <meta name="page-view-size" content="1280*720">
    <link rel="stylesheet" href="css/base.css">
    <link rel="stylesheet" href="css/D_civilization_practice.css">
    <script type="text/javascript" src="lib/js/evm.js"></script>
    <script type="text/javascript" src="lib/js/Evm_djyw.js"></script>
    <script type="text/javascript" src="lib/js/key.js"></script>
    <script src="lib/js/md5.js" type="text/javascript" charset="utf-8"></script>
    <script src="lib/js/jquery-1.11.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="lib/js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/api.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/public.js" type="text/javascript" charset="utf-8"></script>
    <style>
        .model:nth-child(4) {
            display: block;
            width: 100px;
            height: 35px;
            position: absolute;
            top: 450px;
            left: 170px;
            text-align: center;
            background: url(../images/like-1.png) no-repeat;
            background-position: top center;
            background-size: 60px 60px;
            padding-top: 80px;
            font-size: 15px;
            color: #fff;
        }
        
        .theoretical-bg>div:nth-child(7) {
            width: 263px;
            height: 111px;
            position: absolute;
            left: 90px;
            top: 483px;
            border: 3px solid #ccc;
            z-index: 888;
        }
        
        .titlest {
            display: none;
        }
        
        .w_bg {
            position: absolute;
            top: 161px;
            left: 654px;
            width: 536px;
            height: 296px;
            background: white;
            border-radius: 8px;
        }
        
        .theoretical-bg>div:nth-child(6) p {
            width: 100%;
            height: 70px;
            border-bottom: 1px solid rgb(182, 182, 182);
            line-height: 70px;
            font-size: 20px;
            margin-top: 5px;
            padding-bottom: 10px;
            opacity: 0.9;
        }
    </style>
</head>

<body>
    <div class="theoretical-bg" id="theoreticalMain">
        <div id="white-bg"></div>
        <div id="blue-bg"></div>
        <div class="model">
            <img class="addimg" src="" width="100%" height="100%" alt="">
        </div>
        <div class="status"><img src="images/status1.png" alt=""></div>
        <div class="info">
            <div class="title"></div>
        </div>

        <div class="model" id="content">
            <p></p>
            <p></p>
            <p></p>
        </div>
        <!-- <div class="bm_border">
			<div><img class="erweima" src="" alt=""></div>
			<div>微信扫码报名</div>
		</div> -->

        <div class="model">
            <img src="./images/0_slices/228.png" alt="">
        </div>
        <div class="model">
            <img src="./images/3_slices/2522.png" alt="">
        </div>
        <div class="model">
            <img src="./images/3_slices/2523.png" alt="">
        </div>
        <div class="model">
            <img src="./images/3_slices/2524.png" alt="">
        </div>
    </div>
</body>
<script>
    var modelIndex = {

        disUser: false,
        specialState: 'didi',
        index: 2, //初始位置
        listName: 'model', //模块名称
        containerId: 'theoreticalMain', //包含模块的标签id
        thisContain: 'container', //翻滚外容器
        thisDetail: 'content', //翻滚内容
    }
    var articleRun;
    var data = [{
            name: "视频窗口",
            url: "play.html",
            model: 'play'
        }, {
            name: "垃圾分类动态",
            cid: "62",
            url: "D_SingleList.html",
            model: 'junk'
        }, {
            name: "政法规则",
            cid: "73",
            url: "D_SingleList.html",
            model: 'rules'

        },

        {
            name: "活动展示",
            id: "67",
            url: "D_SingleList.html",
            model: "junkActivy",
        }, {
            name: "互动小游戏",
            url: "http://cms.kh.cst-info.cn:8000/rubbish/index.html",
        }, {
            name: "分类常识",
            url: "carrousel.html",
        }
    ];

    function getMessage() {
        var param = {
            id: TV.GetParam('area_id'),
            area_id: TV.GetParam('area_id'),
            // access_token: $.cookie("TV_CST_TOKEN"),

        }
        GetDatas('getArticleList', param, function(err, res) {
                console.log(res)
                var str = ''
                var mess = res.data;
                console.log(mess, '11111111')
                $("#content p:nth-child(1)").html(mess.items[0].title)
                $("#content p:nth-child(2)").html(mess.items[1].title)

                $("#content p:nth-child(3)").html(mess.items[2].title)


            })
            // right.toggleFocus();
    }

    getMessage();


    function direOpt(index, directive) {
        if (directive == "up") { //上
            switch (index) {
                case 0:
                    index = index;
                    break;
                case 2:
                case 3:
                    index = 0;
                    break;
                case 4:
                case 5:
                    index = 1;
                    break;
            }
            console.log('toptop')

            if (index == 1) { //文章翻滚
                TV.articleMove(directive, modelIndex.thisContain, modelIndex.thisDetail);
            }
        } else if (directive == "down") { //下
            console.log('downdown', index)
            switch (index) {
                case 0:
                    index = 2;
                    break;
                case 1:
                    index = 2;
                    break;
                case 2:
                case 3:
                case 4:
                case 5:
                    index = index;
                    break;
            }
            if (index == 1) { //文章翻滚
                console.log(directive, modelIndex.thisContain, modelIndex.thisDetail, '21212')
                TV.articleMove(directive, modelIndex.thisContain, modelIndex.thisDetail);
            }
        } else if (directive == "backwards") { //左
            clearInterval(articleRun)

            switch (index) {
                case 0:
                    index = index;
                    break;
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                    index--;
                    break;
            }

        } else if (directive == "forwards") {
            clearInterval(articleRun)

            switch (index) {
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                    index++;
                    break;
                case 5:
                    index = index;
                    break;
            }
        }
        console.log(index)
        return index;
    }

    function direEnter(index) {
        if (index == 0) {}
        if (index == 1) {
            // window.location.href = data[index].url + "?titles=" + data[index].name + "&model=" + data[index].model;
        }
        if (index == 2) {
            window.location.href = data[index].url + "?titles=" + data[index].name + "&model=" + data[index].model;
        }
        if (index == 3) {
            window.location.href = data[index].url + "?titles=" + data[index].name + "&model=" + data[index].model;
        }
        if (index == 4) {
            window.location.href = data[index].url + "?titles=" + data[index].name + "&model=" + data[index].model;
        }

        if (index == 5) {
            window.location.href = data[index].url + "?titles=" + data[index].name + "&model=" + data[index].model;
        }

    }

    function resOpt(res) {
        // console.log(res)
        if (res.code == 0) {
            if (mess.status == 2) {
                TV.PromptMsg('点赞成功');
                var param = {
                    id: TV.GetParam('id'),
                    area_id: $.cookie('TV_CST_AREA')
                }
                GetDatas('getActivity', param, function(err, res) {
                    mess = res.data;

                    $("#like").html("点赞:" + mess.likes)
                })
            } else {
                getMessage()
                TV.PromptMsg('已成功，请耐心等待')
                setTimeout(function() {
                    window.history.go(-1)
                }, 2000);
            }

        } else if (res.code == 10002) {
            TV.userLogin();
            direEnter(index);
        } else {
            TV.PromptMsg(res.message)
        }
    }
</script>
<script type="text/javascript" src="js/index.js"></script>

</html>